package com.example.springboot.service;

import com.example.springboot.entity.Instore;
import com.example.springboot.mapper.InstoreMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InstoreService {
    @Autowired
    private InstoreMapper instoreMapper;

    public int save(Instore instore){
        if(instore.getId()==null){
            return instoreMapper.insert(instore);
        }else{
            return instoreMapper.update(instore);
        }
    }
}
